package com.fdm.model.DAO;

import com.fdm.model.exceptions.BankPropertiesException;
import com.fdm.model.properties.BankProperties;

public class DAOFactory 
{
	public _AccountDAO getDAO() throws BankPropertiesException
	{
		String storageType = new BankProperties().getStorage();

		try {
			return (_AccountDAO) Class.forName(storageType).newInstance();
		} catch (ClassNotFoundException e) {
			throw new BankPropertiesException();
		} catch (InstantiationException e) {
			throw new BankPropertiesException();
		} catch (IllegalAccessException e) {
			throw new BankPropertiesException();
		}
	}
}